#!/usr/bin/env python3
# -*- coding: utf-8 -*-

from django.db import models
from datetime import datetime;

'''
Account models
'''
__author__ = "HymanHu";

# Create your models here.
class User(models.Model):
    id = models.AutoField(primary_key=True);
    user_name = models.CharField(name="user_name", max_length=20, blank=True, null=True);
    password = models.CharField(max_length=55, blank=True, null=True);
    create_date = models.DateTimeField(auto_now=True, blank=True, null=True);

    def user_dict(self):
        return {
            "id": self.id,
            "userName": self.user_name,
            "password": self.password,
            "createDate": self.create_date.strftime("%Y-%m-%d %H:%M:%S"),
        }

    class Meta:
        db_table = ('python_account_user');